tweaking the last updated album thumbnails

Hi,
I'm trying to get some custom thumbnails for my last updated albums and print them on the main page of my galley, so I try to tweak the image_album_statistics.php plugin but I can't manage to mix the getAlbumThumb() function and the printCustomAlbumThumbImage() function.
Would you be kind enough to tell me what I have to change in this line :
echo "<img src=\"".$tempalbum->getAlbumThumb()."\">\n";
(line 140 of image_album_statistics.php)
to get a 75px x 75px square thumbnail for example (or maybe a simpler way to proceed...) ?

Thank you for your time.

(something else : I don't see the search form anymore till the forum upgrade. Is it normal ?)

Comments

  • acrylian Administrator, Developer
    Hm, good idea, we probably should have that as an option...

    You would have to use `$tempalbum->getAlbumThumbImage()` and a image url like this:
    `WEBPATH.'/'.ZENFOLDER.'/i.php?a='.$tempalbum->name.'&i='.$tempalbum->getAlbumThumbImage()&cw=75&ch=75`

    More about these direct image processing options on top of `zp-core/i.php`
  • flu Member
    Danke Acrylian !
    Excuse me but... where am I supposed to add
    WEBPATH.'/'.ZENFOLDER.'/i.php?a='.$tempalbum->name.'&i='.$tempalbum->getAlbumThumbImage()&cw=75&ch=75
    exactly ?
    As I'm not a coder (as you guess) this simple question is very important to me (anyway I can try to find it by myself but it will take a year getting 1 billion syntax errors).
  • flu Member
    Well, I don't get it :
    I'm not sure how to incorporate this option into my function printAlbumStatisticItem.
    Could you please tell me how to make it work with it :
    `
    function printAlbumStatisticItem($album, $option, $showtitle=false, $showdate=false, $showdesc=false, $desclength=40,$showstatistic='') {
    global $_zp_gallery;
    $albumpath = rewrite_path("/", "index.php?album=");
    $tempalbum = new Album($_zp_gallery, $album['folder']);
    echo "name)."\" title=\"" . htmlspecialchars(strip_tags($tempalbum->getTitle()),ENT_QUOTES) . "\">\n";
    echo "imagegetAlbumThumb()."\">
    \n
    ";
    if($showtitle) {
    echo "

    name)."\" title=\"" . htmlspecialchars(strip_tags($tempalbum->getTitle()),ENT_QUOTES) . "\">\n";
    echo $tempalbum->getTitle()."

    \n";
    }
    `
  • acrylian Administrator, Developer
    The code I posted should replace the `$tempalbum->getAlbumThumb()` in this line `echo "imagegetAlbumThumb()."\">\n
    ";`

    I definatly think about adding that as an option parameter some time, but, well, these functions have already a lot parameters...
  • flu Member
    Thanks Acrylian.
    I'm sorry but I just get an error processing like that.
    I'm not sure to understand exactly where I have to put
    `WEBPATH.'/'.ZENFOLDER.'/i.php?a='.$tempalbum->name.'&i='.$tempalbum->getAlbumThumbImage()&cw=75&ch=75` exactly in the function printAlbumStatisticItem :
    `
    function printAlbumStatisticItem($album, $option, $showtitle=false, $showdate=false, $showdesc=false, $desclength=40,$showstatistic='') {
    global $_zp_gallery;
    $albumpath = rewrite_path("/", "index.php?album=");
    $tempalbum = new Album($_zp_gallery, $album['folder']);
    echo "name)."\" title=\"" . htmlspecialchars(strip_tags($tempalbum->getTitle()),ENT_QUOTES) . "\">\n";
    echo "imagegetAlbumThumbImage()."\">
    \n
    ";
    `
    Sorry to ask again...
  • acrylian Administrator, Developer
    Change `echo "imagegetAlbumThumbImage()."\">\n
    ";`

    to

    `echo "imagename."&i=".$tempalbum->getAlbumThumbImage()."&cw=75&ch=75\">\n
    ";`

    Sorry there was a typo (beware of mixing single and doube quotes!). Also I did not try that myself yet, it should theoretically work...
  • flu Member
    Thank you Acrylian.
    In fact I get this in my generated html code :
    `image`
    which doesn't print the thumbnail. When I directly paste the adress above (mywonderfullwebsite/zenphoto/zp-core/i.php?a=album-name/subalbum-name&i=Object&cw=75&ch=75) in my browser adress bar, I get :
    The Zenphoto object you are requesting cannot be found.
    Album: albums/album-name/subalbum-name
    Image: Object
    Theme page: index
  • acrylian Administrator, Developer
    Ok, I had an error in my example. Since I think about adding it as an option, here we go again:

    Replace the line in question with this:
    `
    $albumthumb = $tempalbum->getAlbumThumbImage();
    echo "imagename."&i=".$albumthumb->name."&s=75&cw=75&ch=75\">\n
    ";
    `
  • flu Member
    Woaw ! That did the trick !
    Wunderbach ! Thank you, Acrylian !
Sign In or Register to comment.